#ifndef INITIALIZATIONTASK_H
#define INITIALIZATIONTASK_H

#include "libs/base/service/request.h"
#include "libs/base/task/task.h"
#include <QObject>

class InitializationTask : public yc::Task
{
    Q_OBJECT
public:
    explicit InitializationTask(QObject* parent = nullptr);

private:
    void startImpl() override;
    void onTimeout() override;
    void onGetAllPlatforms(const yc::Request& request, const yc::Response& response);
    void onGetPlatform(const yc::Request& request, const yc::Response& response);
    void loadLocalData();
    void getPlatform();

    struct Platform
    {
        int id;
        int version;
    };

    QList<Platform> platforms_;
    int pos_ = 0;
};

#endif // INITIALIZATIONTASK_H
